/*
 * Tool.java
 *
 * Created on 9 maj 2007, 18:31
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package pl.krakow.ae.knp.wikiboard.gui.tools;

import java.awt.Graphics2D;
import java.awt.event.MouseEvent;
import pl.krakow.ae.knp.wikiboard.gui.board.BoardEvent;
import pl.krakow.ae.knp.wikiboard.gui.board.BoardEventListener;
import pl.krakow.ae.knp.wikiboard.gui.drawables.Drawable;

/**
 * An abstract class common for all Tools.
 * Defines obligatory fields and methods.
 */
public abstract class Tool 
{
    BoardEventListener listener;
    
    public void addBoardEventListener(BoardEventListener listener)
    {
        this.listener = listener;
    }
    
    public void processBoardEvent(BoardEvent event)
    {
        listener.boardModified(event);
    }
           
    public abstract BoardEvent createEvent();
    
    public abstract void mousePressed(MouseEvent event, Graphics2D g);
    
    public abstract void mouseDragged(MouseEvent event, Graphics2D g);
   
    public abstract void mouseReleased(MouseEvent event, Graphics2D g);
    
    public abstract Drawable getDrawable();
    
}
